import { PAGING } from '@/constant'
import type { SchedulingSelectSchedulingPlanPageParams } from '@/types'

export const formRules = {
  name: [
    {
      required: true,
      message: '名称不能为空！',
      trigger: 'change',
    },
  ],
}

export const defaultPagingParams: Partial<SchedulingSelectSchedulingPlanPageParams>
  = (() => {
    const [a, b]
      = PAGING.RANGE_SHORTCUTS_DAY[0]?.value?.() || []
    return {
      ...PAGING.PARAMS,
      startTime: a?.getTime(),
      endTime: b?.getTime(),
    }
  })()
